import { Controller, Get, Post, Body, Param } from '@nestjs/common';
import { DeptService } from './dept.service';

import { DeptCreateData } from './dept.dto'

@Controller('admin/dept')
export class DeptController {
  constructor(private readonly deptService: DeptService) { }

  @Get('tree')
  getDeptTree() {
    return this.deptService.getDeptTree();

  }

  @Post('add')
  addDept(@Body() data: DeptCreateData) {
    return this.deptService.addDept(data);
  }
}
